//https://leetcode.cn/problems/symmetric-tree/submissions/533681983/
//对称二叉树
//给你一个二叉树的根节点 root ， 检查它是否轴对称。

bool judge(struct TreeNode* root1, struct TreeNode* root2)
{
    if(root1 == NULL && root2 == NULL)
    return true;
    if(root1 == NULL || root2 == NULL || root1->val != root2->val)
    return false;

    return judge(root1->left, root2->right) && judge(root1->right, root2->left);
}

bool isSymmetric(struct TreeNode* root) {
    return judge(root->left, root->right);
}